package com.example.music.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.music.dao.ListSongMapper;
import com.example.music.entity.ListSong;
import com.example.music.service.ListSongService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ListSongServiceImpl extends BaseServiceImpl<ListSong, ListSongMapper> implements ListSongService {
    @Autowired
    ListSongMapper listSongMapper;
    @Override
    protected ListSongMapper getMapper() {
        return listSongMapper;
    }

    @Override
    public List<ListSong> ListSongById(Integer id) {
        QueryWrapper<ListSong> listSongQueryWrapper = new QueryWrapper<>();
        QueryWrapper<ListSong> song_list_id = listSongQueryWrapper.eq("song_list_id", id);
        List<ListSong> listSongs = listSongMapper.selectList(song_list_id);
        return listSongs;
    }
}
